﻿<Page x:Class="WpfViewBox.Window2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window2"  Width="700" Height="500"  >
    <Grid  >
        <Grid.Background>
            <RadialGradientBrush  SpreadMethod="Repeat">
                <RadialGradientBrush.GradientStops>
                    <GradientStop Offset="0.2"  Color="Green"/>
                    <GradientStop Offset="0.5"  Color="LightGreen" />
                </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
        </Grid.Background>
        <Grid.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="50" />
                <Setter Property="TextWrapping" Value="Wrap" />
                <Setter Property="Padding" Value="5" />
            </Style>
        </Grid.Resources>
        <Rectangle Width="1" HorizontalAlignment="Center"  Fill="Red" />
        <Rectangle Width="1" HorizontalAlignment="Right" Margin="0,0,200,0"  Fill="Red"  />
        <Rectangle Width="1" HorizontalAlignment="Left" Margin="200,0,0,0"  Fill="Red"  />

        <Rectangle Height="1"  VerticalAlignment="Center" Fill="Red"  />
        <Rectangle Height="1" Margin="0,125,0,0"  VerticalAlignment="Top" Fill="Red"  />
        <Rectangle Height="1"  Margin="0,0,0,125"   VerticalAlignment="Bottom" Fill="Red"  />

        
        <TextBlock Background="Red" Text="Center"       HorizontalAlignment="Center"  Margin="0,0,0,0"  VerticalAlignment="Center" />

        <TextBlock  Background="AliceBlue" Text="Center+200,0,0,0"   HorizontalAlignment="Center"  Margin="200,0,0,0"  VerticalAlignment="Center"   />
        <TextBlock  Background="Orange" Text="Center+0,0,200,0" Opacity=".8"   HorizontalAlignment="Center"  Margin="0,0,200,0"  VerticalAlignment="Center"  />

        <TextBlock Background="Red" Text="Left+Center" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="100,100,0,0" />

        <TextBlock Background="Red" Text="Left+Top" HorizontalAlignment="Left" VerticalAlignment="Top" />
        <TextBlock Background="CadetBlue" Margin="200,0,0,0"     HorizontalAlignment="Left" VerticalAlignment="Top" Text="Left+Top+200,0,0,0" />
        <TextBlock Background="Azure" Margin="0,100,0,0"     HorizontalAlignment="Left" VerticalAlignment="Top" Text="Left+Top+0,100,0,0" />
        <TextBlock Background="Yellow" Margin="200,100,0,0"     HorizontalAlignment="Left" VerticalAlignment="Top" Text="Left+Top+200,100,0,0" />


        <TextBlock Background="Red" Text="Left+Bottom" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBlock Background="Red" Margin="200,0,0,0" Text="Left+Bottom + 200,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBlock Background="Azure" Margin="0,0,0,100" Text="Left+Bottom + 0,0,0,100" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBlock Background="Azure" Margin="200,0,0,100" Text="Left+Bottom + 200,0,0,100" HorizontalAlignment="Left" VerticalAlignment="Bottom" />

        <TextBlock HorizontalAlignment="Right"  VerticalAlignment="Center"  Width="100" Height="50" Background="LightGoldenrodYellow"  >Right+Center</TextBlock>
        <TextBlock HorizontalAlignment="Right"  VerticalAlignment="Center" Margin="0,0,100,0" Width="100" Height="50" Background="Yellow"  >Right+Center+0,0,100,0</TextBlock>
        <TextBlock HorizontalAlignment="Right"  VerticalAlignment="Center" Margin="0,200,0,0" Width="100" Height="50" Background="LightBlue"  >Right+Center+0,200,0,0</TextBlock>
        <TextBlock HorizontalAlignment="Right"  VerticalAlignment="Center" Margin="0,200,100,0" Width="100" Height="50" Background="Yellow"  >Right+Center+0,200,100,0</TextBlock>


        <Label HorizontalAlignment="Stretch"  Width="200" Height="100" VerticalAlignment="Stretch"  Margin="400,26,200,374"  Background="LightBlue"  >Stretch+Stretch+445,54,123,358</Label>
     
    </Grid>
</Page>